package cn.cttic.base.mapper;

import cn.cttic.base.api.domain.BaseUser;
import cn.cttic.base.api.domain.vo.BaseUserVo;
import cn.cttic.common.mybatis.core.mapper.BaseMapperPlus;
import cn.cttic.order.api.domain.BaseInstallOrder;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 账户信息Mapper接口
 *
 * @author Times.Studio
 * @date 2024-09-17
 */
public interface BaseUserMapper extends BaseMapperPlus<BaseUser, BaseUserVo> {

    /**
     * 通过用户名查询用户
     *
     * @param userName 用户名
     * @return 用户对象信息
     */
    @Select("<script>" +
        "SELECT\n" +
        "	* \n" +
        "FROM\n" +
        "	base_install_order bio\n" +
        "	INNER JOIN base_user bu ON bu.id = bio.install_man_id \n" +
        "WHERE\n" +
        "	bu.id = #{userId} AND bio.`status` = 2" +
        "</script>")
    List<BaseInstallOrder> getProcessingInstallOrderListByUser(@Param(value = "userId") String userId);
}
